home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
splitter
/
split2.frm
< prev
next >
Wrap
Text File
|
1996-02-06
|
4KB
|
146 lines
VERSION 4.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5955
ClientLeft = 1170
ClientTop = 2295
ClientWidth = 5670
Height = 6645
Icon = "Split2.frx":0000
Left = 1110
LinkTopic = "Form1"
MouseIcon = "Split2.frx":0442
ScaleHeight = 397
ScaleMode = 3 'Pixel
ScaleWidth = 378
Top = 1665
Width = 5790
Begin VB.PictureBox Sbar
Align = 2 'Align Bottom
Height = 315
Left = 0
ScaleHeight = 255
ScaleWidth = 5610
TabIndex = 3
Top = 5640
Width = 5670
End
Begin VB.PictureBox Splitter
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 4215
Left = 2760
MouseIcon = "Split2.frx":0594
MousePointer = 99 'Custom
ScaleHeight = 281
ScaleMode = 3 'Pixel
ScaleWidth = 9
TabIndex = 2
TabStop = 0 'False
Top = 540
Width = 135
End
Begin VB.ListBox lstTel
Height = 4350
IntegralHeight = 0 'False
Left = 3180
TabIndex = 1
Top = 120
Width = 2235
End
Begin VB.ListBox lstpers
Height = 4935
IntegralHeight = 0 'False
Left = 60
TabIndex = 0
Top = 180
Width = 2475
End
Begin VB.Menu mnuBar
Caption = "&Exit"
Index = 100
End
End
Attribute VB_Name = "form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private Const P_ECART = 3
Private y1 As Integer
Private y2 As Integer
Private x1 As Integer
Private x2 As Integer
Private width1 As Integer
Private width2 As Integer
Private height1 As Integer
Private height2 As Integer
Private glbfrmInSizeX As Long
Private Sub Form_Load()
glbfrmInSizeX = &H7FFFFFFF
Form_Resize
End Sub
Private Sub splitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If glbfrmInSizeX <> &H7FFFFFFF Then
If CLng(x) <> glbfrmInSizeX Then
Splitter.Move Splitter.Left + x, y1, P_ECART, ScaleHeight - Sbar.Height - 2
glbfrmInSizeX = CLng(x)
End If
End If
End Sub
Private Sub splitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If glbfrmInSizeX <> &H7FFFFFFF Then
If CLng(x) <> glbfrmInSizeX Then
Splitter.Move Splitter.Left + x, y1, P_ECART, ScaleHeight - Sbar.Height - 2
End If
glbfrmInSizeX = &H7FFFFFFF
Splitter.BackColor = &H8000000F
If Splitter.Left > 60 And Splitter.Left < (ScaleWidth - 60) Then
LstPers.Width = Splitter.Left - LstPers.Left
ElseIf Splitter.Left < 60 Then
LstPers.Width = 60
Else
LstPers.Width = ScaleWidth - 60
End If
Form_Resize
End If
End Sub
Private Sub splitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbLeftButton Then
Splitter.BackColor = &H808080
glbfrmInSizeX = CLng(x)
Else
If glbfrmInSizeX <> &H7FFFFFFF Then
splitter_MouseUp Button, Shift, x, y
End If
glbfrmInSizeX = &H7FFFFFFF
End If
End Sub
Private Sub Form_Resize()
Const B_ECART = 1
On Error Resume Next
y1 = B_ECART
height1 = ScaleHeight - Sbar.Height - B_ECART * 2
x1 = B_ECART
width1 = LstPers.Width
x2 = x1 + LstPers.Width + P_ECART - 1
width2 = ScaleWidth - x2 - B_ECART
LstPers.Move x1 - 1, y1, width1, height1
lstTel.Move x2, y1, width2 + 1, height1
Splitter.Move x1 + LstPers.Width - 1, y1, P_ECART, height1
End Sub
Private Sub mnuBar_Click(Index As Integer)
Unload Me
End Sub